from http.server import BaseHTTPRequestHandler
import requests

class WebServices(BaseHTTPRequestHandler):

    s = requests.Session()

    def do_GET(self):
        if self.path == '/':
            self.path = '/demo.html'
        print(self.path)


        try:
            #Reading the file
            file_to_open = open(self.path[1:]).read()
            self.send_response(200)
        except:
            file_to_open = "File not found"
            self.send_response(404)
        
        self.end_headers()
        self.wfile.write(bytes(file_to_open, 'utf-8'))
 
